package com.commander;

import android.content.Context;
import android.widget.RadioGroup;
import com.amap.api.navi.enums.PathPlanningStrategy;
import com.amap.api.navi.model.AMapCarInfo;

import razerdp.basepopup.BasePopupWindow;

public class BasePopup extends BasePopupWindow {
    public BasePopup(Context context) {
        super(context);
        setContentView(createPopupById(R.layout.base_popup));
        RadioGroup radioGroup =findViewById(R.id.RadioGroup);
        AMapCarInfo carInfo = new AMapCarInfo();
        radioGroup.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {

            @Override
            public void onCheckedChanged(RadioGroup radioGroup, int i) {
                BaseActivity.mAMapNavi.stopNavi();
                    switch (i){
                        case R.id.small:
                            BaseActivity.mAMapNavi.setCarInfo(null);
                            break;
                        case R.id.big:
                            BaseActivity.mAMapNavi.setCarInfo(carInfo);
                            break;
                    }
                BaseActivity.mAMapNavi.calculateDriveRoute(BaseActivity.sList,BaseActivity.eList,null, PathPlanningStrategy.DRIVING_MULTIPLE_ROUTES_DEFAULT);

            }
        });
    }
}
